<template>
  <view class="box" @click="informationNoBubbles = false">
    <view class="tou top" :style="'padding-top:' + statusBarHeight1 + 'px'">
      <image
        @click="fanhui"
        class="image1"
        src="https://pic.bangbangtongcheng.com/8937350f727e4eeda6e97ab0d7398e65"
      />
    </view>
    <view class="record">
      <view class="wantRecord">
        <span class="takeNotes">现场记录</span>
        <!-- #ifndef H5 -->
        <image
          class="image"
          @click="soundClick()"
          src="https://pic.bangbangtongcheng.com/static/bbzc/soundRecord.png"
          mode=""
        ></image>
        <!-- #endif -->
      </view>
      <view class="RecordBF" style="margin-top: 20rpx">
        <view style="position: relative" v-for="(i, j) in audio" :key="j">
          <image
            class="RecordBFImage"
            @click.stop="RecordBFClose(j)"
            src="https://pic.bangbangtongcheng.com/static/audioClose.png"
            mode=""
          ></image>
          <recor :URL="i.url"></recor>
        </view>
      </view>
      <view class="kuan">
        <textarea
          class="textarea"
          auto-height
          maxlength="200"
          v-model="reportContent"
          placeholder="您可以将在现场勘查过程中备注的内容详细描述…"
        />
        <span class="numberWords">{{ reportContent.length }}/200</span>
      </view>
      <view class="shangchuan">
        <view class="cu-form-group" style="padding: 0">
          <view class="grid col-4 grid-square flex-sub">
            <view class="bg-img" v-for="(item, index) in imgList" :key="index">
              <image
                v-if="item.type == 'image'"
                @tap.stop="ViewImage"
                :data-url="imgList[index]"
                :src="imgUrl + item.url"
                mode="aspectFit"
              />
              <view v-else class="videoPlay" @click.stop="ylvideo(item.url)">
                <image :src="imgUrl + item.url + '?vframe/jpg/offset/0'" mode="aspectFit"></image>
                <image
                  class="images"
                  src="https://pic.bangbangtongcheng.com/static/bbcz/mdlb-sp01.png"
                  mode=""
                ></image>
              </view>
              <view class="cu-tag bg-red" @tap.stop="DelImg" :data-index="index">
                <text class="cuIcon-close"></text>
              </view>
            </view>
            <view class="solids" @tap="ChooseImage" v-if="index == -1">
              <text class="cuIcon-cameraadd"></text>
            </view>
            <view class="solids" @tap="ChooseImagess" v-if="index == '0' && imgList.length < 9">
              <text class="cuIcon-cameraadd"></text>
            </view>
          </view>
        </view>
      </view>
      <button type="default" class="savebtn" @click="save">保存</button>
      <view class="history">
        <span class="history_left">历史记录</span>
        <span class="history_right" @click="lsjlMore()">更多></span>
      </view>
      <template v-if="JSON.stringify(visitedHistory) !== '{}'">
        <view class="RecordBF" v-if="visitedHistory.languageDescription">
          <view v-for="(i, j) in visitedHistory.languageDescription.split('|')" :key="j">
            <recor :URL="i"></recor>
          </view>
        </view>
        <view class="kuan">
          <textarea
            class="textarea"
            v-model="visitedHistory.recordDescription"
            disabled
            auto-height
            placeholder="历史记录描述历史记录描述…"
          />
        </view>
        <view class="history_image">
          <view class="image" v-for="(i, j) in visitedHistory.remarks" :key="j">
            <image
              style="width: 100%; height: 100%"
              v-if="i.type == 'image'"
              @tap.stop="ViewImage"
              :data-url="i"
              :src="i.url"
              mode="aspectFit"
            />
            <view v-else class="videoPlay" @click.stop="ylvideo(i.url)">
              <image
                style="width: 100%; height: 100%"
                :src="i.url + '?vframe/jpg/offset/0'"
                mode="aspectFit"
              ></image>
              <image
                class="images"
                src="https://pic.bangbangtongcheng.com/static/bbcz/mdlb-sp01.png"
                mode=""
              ></image>
            </view>
          </view>
        </view>
        <view style="text-align: right; margin-top: 14rpx">
          {{ visitedHistory.createDate }}
        </view>
      </template>
      <view v-else class="none">
        <image src="https://pic.bangbangtongcheng.com/static/none.png" mode="widthFix" />
        <view>暂无历史数据</view>
      </view>
    </view>
    <view class="center">
      <view class="center_top">
        <view class="number" @click.stop="informationNoBubbles = !informationNoBubbles">
          信息编号：{{ data.id }}
          <view class="informationNoBubble" v-if="informationNoBubbles">
            <view class="binds_1">
              信息编号是唯一的信息身份号码，可在帮帮同城进行准确搜索查找。
            </view>
            <view class="binds_2"> 联系发布人时可通过信息编号确认信息。 </view>
          </view>
        </view>
        <view class="title">
          {{ data.title }}
        </view>
        <view class="position">
          <view class="position_left">
            <view class="dizhi">{{ data.region }}</view>
            <view class="zhiye">{{ data.positionCategory }}</view>
          </view>
          <view class="position_price">{{
            data.salaryRange == '面议' ? '面议' : data.salaryRange + '元'
          }}</view>
        </view>
        <view class="educationExperience">
          <view class="experience">
            <image
              class="image"
              src="https://pic.bangbangtongcheng.com/static/bbzc/recruitmentDetails/zp_01.png"
              mode=""
            ></image>
            <view class="text">{{ data.yearsService }}</view>
          </view>
          <view class="education">
            <image
              class="image"
              src="https://pic.bangbangtongcheng.com/static/bbzc/recruitmentDetails/zp_02.png"
              mode=""
            ></image>
            <view class="text">{{ data.educationalRequirements }}</view>
          </view>
        </view>
        <view style="width: 690rpx">
          <text style="color: #999999">工作地址：</text>
          {{ data.workLocation }}
          <image
            class="dingwei"
            @click="openMap"
            src="https://pic.bangbangtongcheng.com/static/bbcz/daohang_01.png"
          />
        </view>
        <view class="materialBenefits" v-if="data.fringeBenefits">
          <view class="materialBenefits_title"> 职位福利 </view>
          <view class="materialBenefits_label">
            <view class="label" v-for="(i, j) in data.fringeBenefits.split(',')" :key="j">{{
              i
            }}</view>
          </view>
        </view>
      </view>
      <view class="JobDescription">
        <view class="title"> 职位描述 </view>
        <text class="detailed">
          {{ data.jobDescription }}
        </text>
      </view>
      <!-- 分割线 -->
      <view class="cutApart"></view>

      <view class="center_bottom">
        <view class="Map">
          <view class="title"> 工作地址 </view>
          <view class="maps" @click="openMap">
            <image
              style="width: 100%; height: 100%"
              :src="
                'https://apis.map.qq.com/ws/staticmap/v2/?zoom=11&scale=2&key=HUZBZ-ZQX6X-ZBO4M-TKCO5-7Q6ZZ-Z7FUL&size=345*160&center=' +
                (data.latitude + ',' + data.longitude) +
                '&markers=size:tiny|icon:https://pic.bangbangtongcheng.com/mapicon.png|' +
                (data.latitude + ',' + data.longitude)
              "
              mode=""
            ></image>
            <!-- <map class="AppMap" ref="map1" :scale="13" id="map1" @controltap="controlClick"
							:markers='markers' :controls="controls" :latitude="data.latitude" :longitude="data.longitude">
						</map> -->
          </view>
        </view>
        <view class="corporation">
          <view class="briefIntroduction" @click="companyDetails">
            <view class="title"> 公司简介 </view>
            <image
              class="image"
              src="https://pic.bangbangtongcheng.com/static/bbzc/recruitmentDetails/zp_03.png"
              mode=""
            ></image>
          </view>
          <view class="corporation_center">
            <view class="title">
              {{ data.enterpriseName }}
            </view>
            <text class="content">
              {{ data.companyProfile }}
            </text>
          </view>
          <view class="environment" v-if="data.introductionPicture">
            <image
              class="image"
              v-for="(i, j) in data.introductionPicture.split('|')"
              @click="HJViewImage(i)"
              :key="j"
              :src="i"
              mode="widthFix"
            ></image>
          </view>
          <view
            class="personalCard"
            v-if="data.userInformationDto"
            @click="userfy(data.userInformationDto)"
          >
            <view class="lookOver"> 查看TA的信息 </view>
            <view class="personalCard_center">
              <view class="left">
                <view class="headSculpture">
                  <image
                    class="image"
                    v-if="data.userInformationDto.image"
                    :src="data.userInformationDto.image"
                    mode=""
                  ></image>
                  <image
                    class="image"
                    v-else
                    src="https://pic.bangbangtongcheng.com/static/my/header.png"
                    mode=""
                  ></image>
                  <view class="name">
                    {{
                      data.userInformationDto.isShop == 1
                        ? '商家'
                        : data.userInformationDto.isAgent == 1
                        ? '经纪人'
                        : data.userInformationDto.enterpriseRecruitmentStatus == 1
                        ? '公司'
                        : '个人'
                    }}
                  </view>
                </view>
                <view class="information">
                  <view class="name">
                    {{ data.userInformationDto.nikeName || '未命名用户' }}
                  </view>
                  <text
                    class="vip-label"
                    :style="{
                      backgroundColor:
                        $member.colors()[data.userInformationDto.memberLevel - 1].bgColor,
                      borderColor:
                        $member.colors()[data.userInformationDto.memberLevel - 1].lineColor,
                      color: $member.colors()[data.userInformationDto.memberLevel - 1].wordColor,
                    }"
                  >
                    {{ $member.colors()[data.userInformationDto.memberLevel - 1].level }}
                  </text>
                  <view class="grade">
                    <image
                      class="image"
                      v-for="(item, index) in Number(data.userInformationDto.score)"
                      :key="index + 'rr'"
                      src="https://pic.bangbangtongcheng.com/static/xin_liang.png"
                    />
                    <image
                      class="image"
                      v-for="(item, index) in 5 - data.userInformationDto.score"
                      :key="index + 'tt'"
                      src="https://pic.bangbangtongcheng.com/static/xin_hui.png"
                    />
                  </view>
                </view>
              </view>
              <view class="right">
                <image
                  @click.stop="guanzhu"
                  class="image"
                  v-if="data.userInformationDto.whetherCollection != 0"
                  src="https://pic.bangbangtongcheng.com/static/ysc.png"
                />
                <image
                  class="image"
                  @click.stop="guanzhu"
                  v-else
                  src="https://pic.bangbangtongcheng.com/static/guanzhu.png"
                />
                <view
                  class="GZ"
                  v-if="data.userInformationDto.whetherCollection != 0"
                  @click.stop="guanzhu"
                  >已关注</view
                >
                <view class="GZ" v-else @click.stop="guanzhu">关注</view>
              </view>
            </view>
          </view>
          <view class="disclaimer">
            {{ disclaimers }}
          </view>
        </view>
      </view>
    </view>
    <informationNo ref="informationNo"></informationNo>
    <uniBall></uniBall>
    <previewImgV ref="previewImgV"></previewImgV>
    <uni-popup ref="binds" type="bottom" :safeArea="false">
      <nb-voice-record
        @startRecord="start"
        :recordOptions="duration"
        @endRecord="end"
        @cancelRecord="cancel"
      ></nb-voice-record>
    </uni-popup>
  </view>
</template>
<script>
  import permision from '@/js_sdk/wa-permission/permission.js'
  import previewImgV from '@/components/previewImgV.vue'
  import recor from '@/components/recorPlayback/recor.vue'
  //#ifdef H5
  import wxshare from '../../utils/index.js'
  //#endif
  import { mapGetters } from 'vuex'
  export default {
    data() {
      return {
        id: '',
        imgUrl: this.$imgSrc,
        data: {},
        video: '',
        jjrInfo: {},
        userInfo: uni.getStorageSync('Pduser'),
        imgList: [],
        reportContent: '',
        visitedHistory: '',
        markers: [],
        index: -1,
        disclaimers: '',
        controls: [],
        score: 3,
        audio: [],
        duration: { duration: 30000 },
        informationNoBubbles: false,
        video_chage: false,
		scrollPosition:''
      }
    },
    components: {
      previewImgV: previewImgV,
      recor: recor,
    },
    filters: {
      nums(val) {
        return val.toFixed(2)
      },
      images(url) {
        let arr = url.split('')
        if (arr[0] == '/') {
          return this.imgUrl + url
        } else {
          return url
        }
      },
    },
    onPageScroll(e) {
      if (e.scrollTop <= 200) {
        this.clarity = (e.scrollTop / 200).toFixed(2)
      }
	  this.scrollPosition = e.scrollTop;
	  uni.hideKeyboard();
	  // iOS 复位:ml-citation{ref="3,10" data="citationList"}
	  uni.pageScrollTo({ scrollTop: this.scrollPosition, duration: 0 });
    },
    onLoad(options) {
      var than = this
      this.id = options.id
      this.Disclaimers()
      /* #ifdef H5 */
      this.jinzhi()
      /* #endif */

      /* #ifdef MP-WEIXIN*/
      this.capsuleWidth = wx.getMenuButtonBoundingClientRect().width
      /* #endif */
    },
    onShow() {
      var than = this
      this.doorSeenLsjl()
      this.getData(true)
      setTimeout(function () {
        than.weig = false
      }, 3000)
    },
    methods: {
      RecordBFClose(index) {
        let audios = this.audio
        audios.splice(index, 1)
        this.audio = audios
      },
      companyDetails() {
        uni.navigateTo({
          url:
            '/pages_recruitMoney/recruitmentDetails/companyDetails?userId=' +
            this.data.userInformationDto.id,
        })
      },
      // 信息编号
      informationNos() {
        this.$refs.informationNo.informationNo_xxbh()
      },
      soundClick() {
        console.log('触发了')
        this.$refs.binds.open()
      },
      start() {
        // 开始录音
      },
      end(event) {
        // 结束录音并处理得到的录音文件
        // event中，app端仅有tempFilePath字段，微信小程序还有duration和fileSize两个字段
        let _this = this
        var uper
        uni.showToast({
          title: '请稍候',
          icon: 'none',
          duration: 2000,
        })
        uper = uni.uploadFile({
          // 需要上传的地址
          url: 'https://www.bangbangtongcheng.com/conven/ht/attach/qnUpload',
          // filePath  需要上传的文件
          filePath: event.tempFilePath,
          name: 'file',
          success(res1) {
            _this.audio.push({ type: 'mp3', url: JSON.parse(res1.data).data[0].url })
          },
        })
        // onProgressUpdate 上传对象更新的方法
        uper.onProgressUpdate(function (res) {})
      },
      cancel() {
        // 用户取消录音
      },
      //点击地图控件时触发
      controlClick(e) {
        switch (e.detail.controlId) {
          case 999:
            uni.createMapContext('map1', this).moveToLocation({
              latitude: this.data.latitude,
              longitude: this.data.longitude,
            })
            break
        }
      },
      // 免责声明
      Disclaimers() {
        this.$myRequest
          .get('/api/mobile/public/getDisclaimersByDisclaimerLocation', {
            disclaimerLocation: 12,
          })
          .then((res) => {
            this.disclaimers = res.Disclaimers.disclaimerContent
          })
      },
      guanzhu() {
        if (!this.showLogin()) {
          return
        }
        let that = this
        this.$myRequest
          .post('/api/mobile/vehicleOwner/collectionOrCancelCollection', {
            collectorId: this.userInfo.id,
            relationId: this.data.userInformationDto.id,
            collectionType: '1',
            ids: this.data.userInformationDto.collectionId
              ? this.data.userInformationDto.collectionId
              : '',
          })
          .then((res) => {
            uni.showToast({
              title: res.msg,
              icon: 'none',
              mask: true,
            })
            this.getData()
          })
      },
      ViewImages(url) {
        let arr = []
        arr.push(url.split('|')[0])
        uni.previewImage({
          urls: arr,
          current: url.split('|')[0],
        })
      },
      lsjlMore() {
        uni.navigateTo({
          url: '/pages_owner/my/doorLsjl?id=' + this.id + '&index=3',
        })
      },
      ylvideo(url) {
        this.$refs.previewImgV.open(url)
      },
      ViewImage(e) {
        let image = []
        image.push(e.currentTarget.dataset.url.url)
        uni.previewImage({
          urls: image,
          current: e.currentTarget.dataset.url.url,
        })
      },
      DelImg(e) {
        uni.showModal({
          title: '',
          content: '确定要删除该图片？',
          cancelText: '取消',
          confirmText: '确定',
          success: (res) => {
            if (res.confirm) {
              this.imgList.splice(e.currentTarget.dataset.index, 1)
              if (this.imgList.length == 0) {
                this.index = -1
              }
            }
          },
        })
      },
      ChooseImagess() {
        let _this = this
        let num = 0
        num = 9 - this.imgList.length
        uni.chooseImage({
          count: num,
          sizeType: ['copressed'],
          sourceType: ['camera', 'album'],
          success(res) {
            //因为有一张图片， 输出下标[0]， 直接输出地址
            var imgFiles = res.tempFilePaths
            const tempFiles = res.tempFiles
            let panduan = false
            tempFiles.forEach((i, j) => {
              let length = ''
              // #ifdef H5
              length = i.name.length
              let resType = i.name.substring(length - 1, length)
              // #endif
              // #ifndef H5
              length = i.path.length
              let resType = i.path.substring(length - 1, length)
              // #endif
              if (resType != 'g' && resType != 'G') {
                panduan = true
              }
            })
            if (panduan) {
              uni.showToast({
                title: '不支持当前文件格式',
                icon: 'none',
              })
              return
            }
            if (_this.imgList.length + imgFiles.length > 9) {
              uni.showToast({
                title: '图片最多不能超过9张',
                duration: 2000,
                icon: 'none',
              })
              return
            }
            var uper
            imgFiles.forEach((el) => {
              uni.showToast({
                title: '请稍候',
                icon: 'none',
                duration: 2000,
              })
              uper = uni.uploadFile({
                // 需要上传的地址
                url: 'https://www.bangbangtongcheng.com/conven/ht/attach/qnUpload',
                // filePath  需要上传的文件
                filePath: el,
                name: 'file',
                success(res1) {
                  _this.imgList.push({
                    type: 'image',
                    url: JSON.parse(res1.data).data[0].url,
                  })
                },
              })
            })
            // onProgressUpdate 上传对象更新的方法
            uper.onProgressUpdate(function (res) {})
          },
          fail: (fail) => {
            // uni.showModal({
            //   title: '提示',
            //   content: '操作权限已被拒绝，请手动前往设置',
            //   confirmText: '立即设置',
            //   success: (res) => {
            //     if (res.confirm) {
            //       if (plus.os.name === 'iOS') {
            //         plus.runtime.openURL('app-settings://')
            //       } else {
            //         var Intent = plus.android.importClass('android.content.Intent')
            //         var Settings = plus.android.importClass('android.provider.Settings')
            //         var Uri = plus.android.importClass('android.net.Uri')
            //         var mainActivity = plus.android.runtimeMainActivity()
            //         var intent = new Intent()
            //         intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS)
            //         var uri = Uri.fromParts('package', mainActivity.getPackageName(), null)
            //         intent.setData(uri)
            //         mainActivity.startActivity(intent)
            //       }
            //     }
            //   },
            // })
          },
        })
      },
      ChooseImage() {
        let _this = this
        uni.showActionSheet({
          itemList: ['上传图片', '上传视频'],
          success: (res) => {
            let indexss = res.tapIndex
            if (res.tapIndex == 0) {
              uni.chooseImage({
                count: 9 - _this.imgList.length,
                sizeType: ['copressed'],
                sourceType: ['camera', 'album'],
                success(res) {
                  const tempFiles = res.tempFiles
                  let panduan = false
                  tempFiles.forEach((i, j) => {
                    let length = ''
                    // #ifdef H5
                    length = i.name.length
                    let resType = i.name.substring(length - 1, length)
                    // #endif
                    // #ifndef H5
                    length = i.path.length
                    let resType = i.path.substring(length - 1, length)
                    // #endif
                    if (resType != 'g' && resType != 'G') {
                      panduan = true
                    }
                  })
                  if (panduan) {
                    uni.showToast({
                      title: '不支持当前文件格式',
                      icon: 'none',
                    })
                    return
                  }
                  _this.index = indexss
                  //因为有一张图片， 输出下标[0]， 直接输出地址
                  var imgFiles = res.tempFilePaths
                  // console.log(imgFiles);
                  if (_this.imgList.length + imgFiles.length > 9) {
                    uni.showToast({
                      title: '图片最多不能超过9张',
                      duration: 2000,
                      icon: 'none',
                    })
                    return
                  }
                  var uper
                  imgFiles.forEach((el) => {
                    uni.showToast({
                      title: '请稍候',
                      icon: 'none',
                      duration: 2000,
                    })
                    uper = uni.uploadFile({
                      // 需要上传的地址
                      url: 'https://www.bangbangtongcheng.com/conven/ht/attach/qnUpload',
                      // filePath  需要上传的文件
                      filePath: el,
                      name: 'file',
                      success(res1) {
                        _this.imgList.push({
                          type: 'image',
                          url: JSON.parse(res1.data).data[0].url,
                        })
                      },
                    })
                  })
                  // onProgressUpdate 上传对象更新的方法
                  uper.onProgressUpdate(function (res) {})
                },
                fail: (fail) => {
                  // uni.showModal({
                  //   title: '提示',
                  //   content: '操作权限已被拒绝，请手动前往设置',
                  //   confirmText: '立即设置',
                  //   success: (res) => {
                  //     if (res.confirm) {
                  //       if (plus.os.name === 'iOS') {
                  //         plus.runtime.openURL('app-settings://')
                  //       } else {
                  //         var Intent = plus.android.importClass('android.content.Intent')
                  //         var Settings = plus.android.importClass('android.provider.Settings')
                  //         var Uri = plus.android.importClass('android.net.Uri')
                  //         var mainActivity = plus.android.runtimeMainActivity()
                  //         var intent = new Intent()
                  //         intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS)
                  //         var uri = Uri.fromParts('package', mainActivity.getPackageName(), null)
                  //         intent.setData(uri)
                  //         mainActivity.startActivity(intent)
                  //       }
                  //     }
                  //   },
                  // })
                },
              })
            } else {
              uni.chooseVideo({
                count: 1,
                sourceType: ['camera', 'album'],
                success: (res) => {
                  _this.index = indexss
                  var imgFiles = res.tempFilePath
                  //#ifdef H5
                  const tempFiles = res.tempFile
                  let resSize = tempFiles.size
                  if (resSize > 52428800) {
                    uni.showToast({
                      title: '上传视频大小不能超过50MB',
                      icon: 'error',
                    })
                    return
                  }

                  let resType = tempFiles.type.substring(0, 5)
                  if (resType != 'video') {
                    uni.showToast({
                      title: '不支持当前文件格式',
                      icon: 'error',
                    })
                    return
                  }
                  //#endif
                  uni.showToast({
                    title: '请稍候',
                    icon: 'none',
                    duration: 2000,
                  })
                  var uper
                  uper = uni.uploadFile({
                    // 需要上传的地址
                    url: 'https://www.bangbangtongcheng.com/conven/ht/attach/qnUpload',
                    // filePath  需要上传的文件
                    filePath: imgFiles,
                    name: 'file',
                    success(res1) {
                      _this.imgList.push({
                        type: 'video',
                        url: JSON.parse(res1.data).data[0].url,
                      })
                      _this.video_chage = false
                    },
                    fail: (err) => {
                      uni.showModal({
                        content: err.errMsg,
                        showCancel: false,
                      })
                    },
                    complete: (res) => {
                      _this.video_chage && (_this.video_chage = false)
                      console.log(_this.video_chage, 1010101010)
                    },
                  })
                  uper.onProgressUpdate(function (res) {
                    _this.video_chage = res.progress < 100
                  })
                },
                fail: (fail) => {
                  // uni.showModal({
                  //   title: '提示',
                  //   content: '操作权限已被拒绝，请手动前往设置',
                  //   confirmText: '立即设置',
                  //   success: (res) => {
                  //     if (res.confirm) {
                  //       if (plus.os.name === 'iOS') {
                  //         plus.runtime.openURL('app-settings://')
                  //       } else {
                  //         var Intent = plus.android.importClass('android.content.Intent')
                  //         var Settings = plus.android.importClass('android.provider.Settings')
                  //         var Uri = plus.android.importClass('android.net.Uri')
                  //         var mainActivity = plus.android.runtimeMainActivity()
                  //         var intent = new Intent()
                  //         intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS)
                  //         var uri = Uri.fromParts('package', mainActivity.getPackageName(), null)
                  //         intent.setData(uri)
                  //         mainActivity.startActivity(intent)
                  //       }
                  //     }
                  //   },
                  // })
                },
              })
            }
          },
          fail: function (res) {
            console.log(res.errMsg)
          },
        })
      },
      jinzhi() {
        let _this = this
        let param = window.location.href.split('#')[0]
        uni.request({
          method: 'post',
          data: {
            url: param,
          },
          header: {
            'content-type': 'application/x-www-form-urlencoded',
          },
          url: 'https://www.bangbangtongcheng.com/conven//mob/login/getJsTicket.do',
          success(re) {
            _this.jinzhifx(re.data)
          },
        })
      },
      jinzhifx(data) {
        wxshare.config({
          debug: false, //是否打开调试
          appId: data.appId, // 公众号的唯一标识
          timestamp: data.timestamp, // 生成签名的时间戳
          nonceStr: data.nonce, // ，生成签名的随机串
          signature: data.signature, // 签名
          jsApiList: ['hideMenuItems'],
        })
        // 禁止分享
        wxshare.hideMenuItems({
          // 要隐藏的菜单项，只能隐藏“传播类”和“保护类”按钮，所有menu项见附录3
          menuList: [
            'menuItem:share:appMessage',
            'menuItem:share:timeline',
            'menuItem:share:timeline',
            'menuItem:share:qq',
            'menuItem:favorite',
            'menuItem:share:QZone',
            'menuItem:openWithSafari',
          ],
        })
      },
      chat() {
        if (!this.showLogin()) {
          return
        }
        uni.navigateTo({
          url: `/pages/news/chat1?receiver=${this.jjrInfo.id}&img=${this.jjrInfo.image}&nikeName=${
            this.jjrInfo.userName || this.jjrInfo.nikeName
          }&id=${this.data.id}`,
        })
      },
      fanhui() {
        uni.navigateBack({
          delta: 1,
        })
      },
      async userfy(item) {
        if (!this.showLogin()) {
          return
        }
        let yy = await this.getjjr(item.id)
        if (yy.businessType == 1 && yy.shopType == 2 && yy.isShop == 1) {
          if (!yy.buildingId) {
            uni.showToast({
              title: '该商家还未发布楼盘！',
              icon: 'none',
              mask: true,
            })
            return
          }
          uni.navigateTo({
            url: '/pages_houses/houses/housesDetails?id=' + yy.buildingId,
          })
          return
        }
        if (yy.businessType == 1 && yy.shopType == 1 && yy.isShop == 1) {
          uni.navigateTo({
            url: '/pages_intermediary/shopDetails?id=' + yy.shopId,
          })
          return
        }
        if (yy.businessType == 2 && (yy.shopType == 1 || yy.shopType == 2) && yy.isShop == 1) {
          uni.navigateTo({
            url: '/pages_owner/dealer/dealerDetails?id=' + yy.shopId,
          })
          return
        }
        if (yy.businessType == 2 && (yy.shopType == 3 || yy.shopType == 4) && yy.isShop == 1) {
          uni.navigateTo({
            url: '/pages_owner/ownerService/ownerServiceDetails?id=' + yy.shopId,
          })
          return
        }
        if (yy.businessType == 0 && yy.enterpriseRecruitmentStatus == 1) {
          uni.navigateTo({
            url: '/pages_recruitMoney/recruitmentDetails/companyDetails?userId=' + yy.id,
          })
          return
        }
        uni.navigateTo({
          url: '/pages_owner/dealer/goldConsultant?userId=' + item.id,
        })
      },
      async getjjr(id) {
        let that = this
        let data = {}
        await this.$myRequest
          .get('/api/mobile/public/getPersonalHome', {
            otherId: id,
            ownerId: this.userInfo.id,
          })
          .then((res) => {
            data = res.personalHomeData
          })
        return data
      },
      openMap() {
        // console.log(this.data.latitude, this.data.longitude);
        let that = this
        /* #ifdef H5 */
        let param = window.location.href.split('#')[0]
        uni.request({
          method: 'post',
          data: {
            url: param,
          },
          header: {
            'content-type': 'application/x-www-form-urlencoded',
          },
          url: 'https://www.bangbangtongcheng.com/conven//mob/login/getJsTicket.do',
          success(re) {
            uni.hideLoading()
            wxshare.config({
              debug: false, //是否打开调试
              appId: re.data.appId, // 公众号的唯一标识
              timestamp: re.data.timestamp, // 生成签名的时间戳
              nonceStr: re.data.nonce, // ，生成签名的随机串
              signature: re.data.signature, // 签名
              jsApiList: ['openLocation'],
            })
            wxshare.ready(function () {
              wxshare.openLocation({
                latitude: Number(that.data.latitude), //目的地latitude
                longitude: Number(that.data.longitude), //目的地longitude
                // name: that.data.title,
                // address: that.data.address,
                scale: 15, //地图缩放大小，可根据情况具体调整
              })
            })
          },
        })
        /* #endif */
        /* #ifndef H5 */
        uni.openLocation({
          latitude: Number(that.data.latitude),
          longitude: Number(that.data.longitude),
          name: that.data.address,
          success: function () {
            console.log('success')
          },
        })
        /* #endif */
      },
      clickImg(url, index) {
        url = url.map((v) => {
          v = this.imgUrl + v
          return v
        })
        wx.previewImage({
          urls: url, //需要预览的图片http链接列表，多张的时候，url直接写在后面就行了
          current: index, // 当前显示图片的http链接，默认是第一个
          indicator: 'number',
          success: function (res) {},
          fail: function (res) {},
          complete: function (res) {},
        })
      },
      getData(status) {
        let that = this
        this.$myRequest
          .get('/api/mobile/personnelOwner/getRecruitmentById', {
            id: this.id,
            userId: this.userInfo.id,
          })
          .then((res) => {
            this.data = res.recommendedPosition
            if (res.recommendedPosition.latitude) {
              this.markers = [
                {
                  id: 1,
                  latitude: res.recommendedPosition.latitude,
                  longitude: res.recommendedPosition.longitude,
                  iconPath: 'https://pic.bangbangtongcheng.com/locationpic.png',
                  width: 30,
                  height: 30,
                  anchor: {
                    x: 0.5,
                    y: 0.5,
                  },
                },
              ]
            }
            that.$nextTick(() => {
              setTimeout(() => {
                // if(!this.controls.length){
                // 	this.mapdian()
                // }
              }, 1000)
            })
          })
      },
      mapdian() {
        this.$nextTick(() => {
          uni
            .createSelectorQuery()
            .in(this)
            .select('.maps')
            .fields(
              {
                size: true,
              },
              (res) => {
                this.controls.push({
                  id: 999,
                  iconPath: 'https://pic.bangbangtongcheng.com/static/dingwei1.png',
                  clickable: true,
                  position: {
                    left: res.width - 50,
                    top: 100,
                    width: 50,
                    height: 60,
                  },
                })
              }
            )
            .exec()
        })
      },
      // 获取历史记录
      doorSeenLsjl() {
        let that = this
        this.$myRequest
          .get('/api/mobile/personnelOwner/queryVisitedHistory', {
            userId: this.userInfo.id,
            relatedBusiness: this.id,
            visitType: 1,
          })
          .then((res) => {
            if (res.visitedHistory.remarks) {
              res.visitedHistory.remarks = JSON.parse(res.visitedHistory.remarks)
            }
            this.visitedHistory = res.visitedHistory
          })
      },
      // 保存
      save() {
        if (this.video_chage) {
          uni.showToast({
            title: '上传视频中，请稍后！',
            icon: 'none',
            mask: true,
          })
          return
        }
        if (!this.reportContent && !this.imgList.length && !this.audio.length) {
          uni.showToast({
            title: '请填写记录内容',
            icon: 'none',
            mask: true,
          })
          return
        }
        let image = []
        let video = []
        let remarks = JSON.stringify(this.imgList)
        this.imgList.forEach((v) => {
          if (v.type == 'image') {
            image.push(v.url)
          } else {
            video.push(v.url)
          }
        })
        let audio = []
        this.audio.forEach((v) => {
          audio.push(v.url)
        })
        this.$myRequest
          .post('/api/mobile/personnelOwner/increaseVisitedLook', {
            noteTaker: this.userInfo.id,
            relatedBusiness: this.data.id,
            recordDescription: this.reportContent,
            languageDescription: audio.length == 0 ? '' : audio.join('|'),
            recordPicture: image.length == 0 ? '' : image.join('|'),
            recordVideo: video.length == 0 ? '' : video.join('|'),
            remarks: remarks,
            visitType: '1',
          })
          .then((res) => {
            uni.showToast({
              title: '保存成功',
              icon: 'none',
              mask: true,
            })
            setTimeout(() => {
              uni.navigateBack({
                delta: 1,
              })
            }, 500)
          })
      },
    },
    computed: {
      price() {
        return this.data.price
      },
      UnitPrice() {
        return ((this.data.price * 10000) / this.data.area).toFixed(2)
      },
      ...mapGetters(['userid', 'islogin', 'statusBarHeight1', 'userinfo']),
    },
  }
</script>
<style lang="less" scoped>
  .inContrastB {
    width: 146rpx;
    height: 52rpx;
    border-radius: 22rpx;
    border: 2px solid #ffffff;
    font-size: 26rpx;
    font-weight: 400;
    color: #ffffff;
    text-align: center;
    line-height: 52rpx;
    margin: 0 40rpx;
  }
  .none {
    text-align: center;

    image {
      width: 230rpx;
      margin-bottom: 16rpx;
    }

    view {
      height: 40rpx;
      line-height: 40rpx;
      color: #666;
    }
  }
  .inContrastH {
    width: 146rpx;
    height: 52rpx;
    border-radius: 22rpx;
    border: 2px solid #000;
    font-size: 26rpx;
    font-weight: 400;
    color: #000;
    text-align: center;
    line-height: 52rpx;
    margin: 0 40rpx;
  }
  .shangchuan {
    margin-top: 24rpx;
    .videoPlay {
      width: 100%;
      height: 100%;
      .images {
        width: 40rpx;
        height: 40rpx;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
      }
    }
  }
  .record {
    margin: 30rpx 40rpx 32rpx 40rpx;
    .wantRecord {
      display: flex;
      align-items: center;
      .takeNotes {
        font-size: 36rpx;
        font-weight: 600;
        color: #64b6a8;
        margin-right: 18rpx;
      }
      .image {
        width: 30rpx;
        height: 40rpx;
        margin: 0;
      }
    }
    .RecordBF {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      .iteam {
        width: 140rpx;
        height: 50rpx;
        background-color: #ffffff;
        border-radius: 8rpx;
        border: 1px solid #c4c4c4;
        display: flex;
        align-items: center;
        justify-content: space-evenly;
        margin-right: 20rpx;
        margin-bottom: 20rpx;
        .image {
          width: 24rpx;
          height: 24rpx;
          margin: 0;
        }
        .text {
          font-size: 24rpx;
          font-weight: 400;
          color: #333333;
        }
      }
      .RecordBFImage {
        position: absolute;
        width: 40rpx;
        height: 40rpx;
        right: 0;
        top: -20rpx;
      }
    }
    .kuan {
      width: 670rpx;
      min-height: 200rpx;
      margin-top: 20rpx;
      border: 1px solid #c9c9c9;
      position: relative;
      .textarea {
        min-height: 180rpx;
        width: 620rpx;
        margin-left: 24rpx;
        margin-top: 14rpx;
        line-height: 50rpx;
        letter-spacing: 2rpx;
        padding-bottom: 50rpx;
        font-size: 24rpx;
      }
      .numberWords {
        position: absolute;
        bottom: 10rpx;
        right: 10rpx;
        color: #64b6a8;
        font-size: 24rpx;
      }
    }
    .savebtn {
      width: 670rpx;
      height: 80rpx;
      background: #64b6a8;
      border-radius: 49rpx;
      margin: 0;
      padding: 0;
      color: #fff;
    }
    .history {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-top: 40rpx;
      .history_left {
        font-size: 34rpx;
        font-weight: 600;
        color: #333333;
      }
      .history_right {
        font-size: 26rpx;
        color: #999999;
      }
    }
    .history_image {
      display: flex;
      align-items: center;
      // justify-content: space-between;
      flex-wrap: wrap;
      margin-top: 20rpx;
      /deep/ uni-image {
        margin-top: 0;
      }
      .image {
        width: 200rpx;
        height: 200rpx;
        margin-right: 20rpx;
        margin-bottom: 20rpx;
        .videoPlay {
          width: 100%;
          height: 100%;
          position: relative;
          .images {
            width: 40rpx;
            height: 40rpx;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
          }
        }
      }
    }
  }
  .new-title-wrapper {
    background-color: red;
    width: 100%;
    height: 88rpx;
    z-index: 1;
    position: fixed;
    top: 0;
    left: 0;
  }

  .box {
    width: 100%;
    padding-bottom: 20rpx;
    background-color: #fff;
    margin-top: 0 !important;
  }
  .disclaimer {
    width: 100%;
    margin-top: 20rpx;
    padding-left: 30rpx;
    padding-right: 30rpx;
    padding-top: 20rpx;
    font-size: 26rpx;
    color: #a19898;
    // margin-left:50rpx;
    word-break: break-all;
    margin-top: 16rpx;
  }

  .tou {
    position: relative;
    width: 100%;
    height: 66rpx;
    text-align: center;
    line-height: 88rpx;
    font-size: 36rpx;
    background-color: transparent;
    color: #fff;
    /* #ifdef MP-WEIXIN */
    text-align: left;
    display: flex;
    align-items: center;
    /* #endif */
    .image1 {
      position: absolute;
      width: 32rpx;
      height: 32rpx;
      left: 30rpx;
    }
  }
  .center {
    width: 100%;
    margin-top: 54rpx;

    .center_top {
      margin: 0 30rpx;
      padding-bottom: 36rpx;
      border-bottom: 1px dashed #d0d0d0;

      .number {
        font-size: 28rpx;
        font-weight: 400;
        color: #64b6a8;
        margin-bottom: 20rpx;
        position: relative;
        .informationNoBubble {
          width: 500rpx;
          padding: 10rpx;
          border-radius: 10rpx;
          background-color: #ffffff;
          position: absolute;
          bottom: -150rpx;
          border: 1px solid #888;
          left: 150rpx;
          z-index: 1;
          .binds_1 {
            font-size: 24rpx;
            font-weight: 400;
            color: #333333;
            margin-bottom: 10rpx;
          }
          .binds_2 {
            font-size: 24rpx;
            font-weight: 400;
            color: #64b6a8;
          }
          &::before {
            width: 0px;
            height: 0px;
            position: absolute;
            padding: 0;
            border-left: 24rpx solid transparent;
            border-right: 20rpx solid transparent;
            border-bottom: 24rpx solid #fff;
            content: '';
            z-index: 12;
            position: absolute;
            left: 12rpx;
            top: -20rpx;
          }
          &::after {
            width: 0px;
            height: 0px;
            position: absolute;
            padding: 0;
            border-left: 24rpx solid transparent;
            border-right: 20rpx solid transparent;
            border-bottom: 24rpx solid #888;
            content: '';
            z-index: 10;
            position: absolute;
            left: 12rpx;
            top: -24rpx;
          }
        }
      }

      .title {
        font-size: 34rpx;
        font-weight: 600;
        color: #333333;
        margin-bottom: 24rpx;
      }

      .position {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 20rpx;

        .position_left {
          display: flex;
          align-items: center;

          .dizhi {
            font-size: 28rpx;
            font-weight: 400;
            color: #888888;
            margin-right: 24rpx;
          }

          .zhiye {
            font-size: 28rpx;
            font-weight: 400;
            color: #333;
          }
        }

        .position_price {
          font-size: 32rpx;
          font-weight: 600;
          color: #e32d2d;
        }
      }

      .educationExperience {
        display: flex;
        align-items: center;
        margin-bottom: 30rpx;
        justify-content: space-between;

        .experience {
          display: flex;
          align-items: center;
          // margin-right: 60rpx;

          .image {
            width: 24rpx;
            height: 24rpx;
            margin-right: 10rpx;
          }

          .text {
            font-size: 28rpx;
            font-weight: 400;
            color: #333333;
          }
        }

        .education {
          display: flex;
          align-items: center;

          .image {
            width: 26rpx;
            height: 24rpx;
            margin-right: 10rpx;
          }

          .text {
            font-size: 28rpx;
            font-weight: 400;
            color: #333333;
          }
        }
      }

      .materialBenefits {
        .materialBenefits_title {
          font-size: 34rpx;
          font-weight: 550;
          color: #333333;
          margin-bottom: 10rpx;
        }

        .materialBenefits_label {
          display: flex;
          align-items: center;
          flex-wrap: wrap;

          .label {
            padding: 10rpx;
            font-size: 24rpx;
            font-weight: 400;
            color: #333333;
            margin-right: 18rpx;
            margin-bottom: 18rpx;
            background-color: #f0f0f0;
            border-radius: 4rpx;
          }
        }
      }
    }

    .JobDescription {
      width: 750rpx;
      padding: 0 30rpx;
      margin: 32rpx 0 32rpx 0;

      .title {
        font-size: 34rpx;
        font-weight: 550;
        color: #333333;
        margin-bottom: 16rpx;
      }

      .detailed {
        font-size: 26rpx;
        font-weight: 400;
        color: #333333;
        line-height: 50rpx;
      }
    }

    .cutApart {
      width: 750rpx;
      height: 20rpx;
      background-color: #f2f2f2;
    }

    .center_bottom {
      width: 750rpx;
      padding: 0 30rpx;

      .Map {
        margin-top: 32rpx;
        margin-bottom: 32rpx;
        width: 690rpx;

        .title {
          font-size: 34rpx;
          font-weight: 550;
          color: #333333;
          margin-bottom: 16rpx;
        }

        .maps {
          width: 100%;
          height: 324rpx;

          .AppMap {
            width: 100%;
            height: 100%;
            border-radius: 16rpx;
            overflow: hidden;
          }
        }
      }

      .corporation {
        .briefIntroduction {
          display: flex;
          align-items: center;
          justify-content: space-between;
          margin-bottom: 16rpx;

          .title {
            font-size: 34rpx;
            font-weight: 550;
            color: #333333;
          }

          .image {
            width: 38rpx;
            height: 38rpx;
          }
        }

        .corporation_center {
          margin-bottom: 16rpx;

          .title {
            font-size: 32rpx;
            font-weight: 550;
            color: #333333;
            margin-bottom: 10rpx;
          }

          .content {
            font-size: 26rpx;
            font-weight: 400;
            color: #333333;
          }
        }

        .environment {
          .image {
            width: 100%;
          }
        }

        .personalCard {
          width: 100%;
          height: 222rpx;
          background-color: #ffffff;
          box-shadow: 0px 0px 6rpx 1rpx rgba(0, 0, 0, 0.16);
          border-radius: 18rpx;
          margin-top: 32rpx;
          margin-bottom: 45rpx;
          position: relative;

          .lookOver {
            width: 200rpx;
            height: 60rpx;
            background-color: #64b6a8;
            border-radius: 0px 18rpx 0px 18rpx;
            position: absolute;
            top: 0;
            right: 0;
            font-size: 24rpx;
            font-weight: 400;
            color: #ffffff;
            display: flex;
            align-items: center;
            justify-content: center;
          }

          .personalCard_center {
            display: flex;
            align-items: center;
            justify-content: space-between;
            height: 100%;

            .left {
              margin-left: 30rpx;
              display: flex;
              align-items: center;
              height: 100%;

              .headSculpture {
                position: relative;
                width: 120rpx;
                height: 120rpx;

                .image {
                  width: 120rpx;
                  height: 120rpx;
                  border-radius: 120rpx;
                }

                .name {
                  position: absolute;
                  bottom: 0;
                  left: 50%;
                  transform: translateX(-50%);
                  width: 100rpx;
                  height: 36rpx;
                  font-size: 24rpx;
                  color: #fff;
                  text-align: center;
                  line-height: 36rpx;
                  background: url('https://pic.bangbangtongcheng.com/static/name.png');
                  background-size: 100% 100%;
                }
              }

              .information {
                margin-left: 24rpx;
                padding: 32rpx 0;
                // display: flex;
                // flex-direction: column;
                // justify-content: space-between;

                .name {
                  width: 300rpx;
                  text-overflow: ellipsis;
                  white-space: nowrap;
                  overflow: hidden;
                  font-size: 36rpx;
                  font-weight: 400;
                  color: #333333;
                  margin-bottom: 10rpx;
                }

                .vip-label {
                  padding: 3rpx 6rpx;
                  background: #f6f0ff;
                  border-radius: 6rpx 6rpx 6rpx 6rpx;
                  opacity: 1;
                  border: 2rpx solid #bd90d9;
                  font-size: 24rpx;
                  font-weight: 500;
                  color: #bd90d9;
                }

                .grade {
                  display: flex;
                  align-items: center;
                  margin-top: 10rpx;

                  .image {
                    width: 40rpx;
                    height: 40rpx;
                    margin-right: 10rpx;
                  }
                }
              }
            }

            .right {
              margin-right: 40rpx;
              display: flex;
              align-items: center;

              .image {
                width: 54rpx;
                height: 54rpx;
                margin-right: 10rpx;
              }

              .GZ {
                font-size: 24rpx;
                font-weight: 400;
                color: #333333;
              }
            }
          }
        }

        .disclaimer {
          font-size: 24rpx;
          font-weight: 400;
          color: #989898;
          line-height: 40rpx;
        }
      }
    }
  }
  .dingwei {
    width: 50rpx;
    height: 50rpx;
    vertical-align: middle;
    margin-bottom: 20rpx;
  }
</style>
